<link href="<?php echo base_url(); ?>assets/lightbox/lightbox.css" rel="stylesheet" type="text/css" />
<script src="<?php echo base_url(); ?>assets/lightbox/jquery.lightbox.js" type="text/javascript" ></script>
<script>
	jQuery(document).ready(function(){
		jQuery(".lightbox").lightbox(
           
        );
	});

</script>
<script>
function show_(id){
    for(i=1; i<6;i++){
        if(i==id){
            jQuery('#show_'+i).fadeIn('slow');
        }
        else{
            document.getElementById('show_'+i).style.display = "none";
        }
    }
}
</script>

<div class="temp2">
    <p><?php echo $this->lang->line('fm_events'); ?></p>
</div>
<div>
<?php
if(count($news)>0)
{
	$begindate=my_int_date($news[0]['begin_date']);
	$enddate=my_int_date($news[0]['end_date']);					
?>
    <div class="title_home3">
        <div>
            
            <div class="aricle_title"><?php echo $news[0]['name']; ?></div>
            <div class="clear_left"></div>
        </div>
    </div>
    <div class="text_home">    
    
        <div style="float: left;margin: 0;padding: 0;width: 330px;">
            <div class="p10r">
            <div style="font-size:14px"><strong>Address</strong>:<br /><?php echo $news[0]['address']; ?><br /><br /></div>
            <div style="font-size:14px">
                <strong>Date</strong>:<br /> <?php echo $begindate."  -  ".$enddate ?>
            </div>
            
            <div class="p15t"><h4><?php echo $news[0]['title']; ?></h4><br>
          <?php echo str_replace("../../../../","../../",$news[0]['content']) ?>

            </div>
            </div>
        </div>
        
        <div style="margin: 0; padding:0; width: 370px; float:left;">
        
        
            <div style="margin:0; padding:0; width: 100%; height: 280px;">
                 <?php 
        		 if(isset($gallery) && (count($gallery)>0)) 
        		 {    $i=1;
        			 foreach($gallery as $item)
        			 {
        				 if($item['image']!=NULL)
        				 {
        		 ?>
                <div id="show_<?php echo $i;?>" <?php if($i==1){echo 'style="display: block;"';} else {echo 'style="display: none;"';}?>>
                    <a class="lightbox" rel="flowers"  href="<?php echo base_url(); ?>upload_file/article/<?php echo $item['image']; ?>">
                        <img src="<?php echo base_url(); ?>assets/auto_thumbnail/timthumb.php?src=<?php echo base_url(); ?>upload_file/article/<?php echo $item['image']; ?>&h=280&w=370&zc=1" />
                    </a>
                </div>
                 <?php 
        				 }
        		  $i++;	 }
        		 }
        		 ?>
            </div>
            <div style="margin: 0; padding: 20px 0;">
                <div id="gallery">
                 <?php 
        		 if(isset($gallery) && (count($gallery)>0)) 
        		 {    $i=1;
        			 foreach($gallery as $item)
        			 {
        				 if($item['image']!=NULL)
        				 {
        		 ?>
                <div style="float:left; <?php if($i==5){echo 'width:60px';} else {echo 'width:77px';}?>">
                    <a href="javascript:void(0);" onclick="show_('<?php echo $i; ?>');">
                        <img src="<?php echo base_url(); ?>assets/auto_thumbnail/timthumb.php?src=<?php echo base_url(); ?>upload_file/article/<?php echo $item['image']; ?>&h=45&w=60&zc=1" />
                    </a>
                </div>
                <?php 
        				 }
        		  $i++;	 }
        		 }
        		 ?>
                 <div class="clear_left"></div>
                </div>    
            </div>

            <?php 
    		 if($news[0]['address']!='') 
    		 {
    		 ?>
            <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAizzYg6xZplLX49NbT4cmOxQQicEaWJlWjmjrFeoy3YvMslExfhQnSz90Da8gIWbdzTOPhXIXUW8tgw" type="text/javascript"></script>
            <script type="text/javascript">
            var map = null;
            var geocoder = null;
            var lat = null;
            var lng = null;
            
            function showAddress(){
                var address = '<?php echo $news[0]['address']?>';
                var geocoder = new GClientGeocoder();
            	geocoder.getLatLng(
            		address,
            		function(point){
            			if (!point){
                            alert(address + " not found");         
            				return true;
            		 	}
            		 	else {
                            map.setCenter(point, 16);
                            var marker = new GMarker(point);
                            map.addOverlay(marker);
                            marker.openInfoWindow(document.createTextNode(address));
            				return true;
            		 	}
            		}
               );
            }
            function init() {
                /*
                var address = '<?php echo $news[0]['address']?>';
                geocoder = new GClientGeocoder();
                geocoder.getLatLng(
                	address,
                	function(point){
                		if (!point){  
                            document.getElementById("lat").value = 55.834318;
                            document.getElementById("lng").value = 10.585522;
                          
                			return true;
                	 	}
                	 	else {
                			currentX = point.lat();
                			currentY = point.lng();
                            document.getElementById("lat").value = currentX;
                			document.getElementById("lng").value = currentY;
                			return true;
                	 	}
                	}
                
                );
                var lat = document.getElementById("lat").value;
                var lng = document.getElementById("lng").value;
                var map = new GMap2(document.getElementById("map_id"));
                map.setCenter(new GLatLng(lat, lng), 8);
                map.setUIToDefault();
                var point = new GPoint(lng, lat);
                var marker = new GMarker(point);
                map.addOverlay(marker);
                marker.openInfoWindow(document.createTextNode(address));
                */
                
                
                map = new GMap2(document.getElementById("map_id"));
                map.setCenter(new GLatLng(55.834318, 10.585522), 16);
                map.setUIToDefault();
                geocoder = new GClientGeocoder();
                showAddress();
                
                
            
            }
            
            window.onload = init;
            window.onunload = GUnload;
            </script>
            <input type="hidden" name="lat" id="lat" value=""/>
            <input type="hidden" name="lng" id="lng" value=""/>
            
            
            <div id="map_id" style="width: 370px; height: 270px"></div>
             
             
            <!--iframe width="370" height="270" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=1413+K+Street+NW,+Washington+DC&amp;sll=38.902127,-77.032808&amp;sspn=0.012557,0.01929&amp;ie=UTF8&amp;hq=&amp;hnear=1413+K+St+NW,+Washington+D.C.,+District+of+Columbia,+20533&amp;z=14&amp;ll=38.902658,-77.032658&amp;output=embed"></iframe>
            <p><br /><small><a href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=1413+K+Street+NW,+Washington+DC&amp;sll=38.902127,-77.032808&amp;sspn=0.012557,0.01929&amp;ie=UTF8&amp;hq=&amp;hnear=1413+K+St+NW,+Washington+D.C.,+District+of+Columbia,+20533&amp;z=14&amp;ll=38.902658,-77.032658" style="color:#0000FF;text-align:left" target="_blank">View Larger Map</a></small></p-->
            <?php 
    		 }
    		 ?>
        </div>
        
        <div class="clear_left"></div>
    </div>


<?php
}
?>  
</div>
<script>
jQuery(document).ready(function(){
	jQuery("#events_active").addClass('current');
});
</script>